//
//  UIView+Extension.swift
//  CommonTool
//
//  Created by tenroadshow on 12.1.22.
//

import UIKit

public extension UIView {
    static var reuseId: String {
        get {
            return NSStringFromClass(self.classForCoder())
        }
    }
}


public extension UIView {
    
    func addSubviews(childs: [UIView]) {
        childs.forEach { addSubview($0) }
    }
    
    func roundCorners(_ corners: UIRectCorner, roundedRect: CGRect, radius: CGFloat) {
        let maskPath = UIBezierPath(
            roundedRect: roundedRect,
            byRoundingCorners: corners,
            cornerRadii: CGSize(width: radius, height: radius))

        let shape = CAShapeLayer()
        shape.path = maskPath.cgPath
        layer.mask = shape
    }
}

